import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/layout';
import layoutSchool from '@/layoutSchool';
import layoutCollege from '@/layoutCollege';
import layoutHome from '@/layoutHome';
import layoutCollegeDetail from '@/layoutCollegeDetail';
const routes = [
  {
    path: '/',
    redirect: '/home',
    component: Layout,
    children: [
      {
        path: '/home',
        meta: { title: '首页' },
        component: () => import('@/views/home/index.vue'),
      },
      {
        path: '/pingresult',
        name: 'pingresult',
        meta: { title: '测评报告结果' },
        component: () => import('@/views/ping/pingResult.vue'),
      },
      {
        path: '/about',
        meta: { title: '关于我们' },
        component: () => import('@/views/about/index.vue'),
      },
      {
        path: '/useragree',
        meta: { title: '用户协议' },
        component: () => import('@/views/userAgree/index.vue'),
      },
      {
        path: '/privacypolicy',
        meta: { title: '隐私政策' },
        component: () => import('@/views/privacyPolicy/index.vue'),
      },
      {
        path: '/:pathMatch(.*)*',
        component: () => import('@/views/error/404.vue'),
      },
      {
        path: '/news',
        meta: { title: '高考资讯' },
        component: () => import('@/views/news/index.vue'),
      },
      {
        path: '/news/detail',
        meta: { title: '高考资讯详情' },
        component: () => import('@/views/newDet/index.vue'),
      },
      {
        path: '/experts',
        meta: { title: '咨询师' },
        component: () => import('@/views/experts/index.vue'),
      },
      {
        path: '/shopserve',
        meta: { title: '商品服务' },
        component: () => import('@/views/shopServe/index.vue'),
      },
      {
        path: '/ziYclassrooms',
        meta: { title: '志愿讲堂' },
        component: () => import('@/views/ziYclassrooms/index.vue'),
      },
      {
        path: '/ziYclassroomsDetail',
        meta: { title: '志愿讲堂详情' },
        component: () => import('@/views/ziYclassroomsDetail/index.vue'),
      },
      {
        path: '/shopserve/shopDet',
        meta: { title: '商品服务详情' },
        component: () => import('@/views/shopDet/index.vue'),
      },
      {
        path: '/zYshopDet',
        meta: { title: '升学课堂商品服务详情' },
        component: () => import('@/views/zYshopDet/index.vue'),
      },
      {
        path: '/expert-one-on-one',
        meta: { title: '专家一对一' },
        component: () => import('@/views/expertOneOnOne/index.vue'),
      },
      {
        path: '/homesearch',
        name: 'homeSearch',
        meta: { title: '首页搜素' },
        component: () => import('@/views/homeSearch/index.vue'),
      },

      {
        path: '/login',
        meta: { title: '登录' },
        component: () => import('@/views/login'),
      },
    ],
  },
  // 个人中心layput
  {
    path: '/usercenter',
    redirect: '/usercenter',
    component: layoutHome,
    children: [
      {
        path: '/usercenter',
        meta: { title: '个人中心' },
        component: () => import('@/views/user'),
      },
      {
        path: '/followSchool',
        meta: { title: '关注学校' },
        component: () => import('@/views/followSchool'),
      },
      {
        path: '/followProfession',
        meta: { title: '关注专业' },
        component: () => import('@/views/followProfession'),
      },
      {
        path: '/article',
        meta: { title: '文章' },
        component: () => import('@/views/article'),
      },
      {
        path: '/mysubject',
        meta: { title: '选科方案' },
        component: () => import('@/views/mySubject'),
      },
      {
        path: '/applicationSquare',
        meta: { title: '应用广场' },
        component: () => import('@/views/applicationSquare'),
      },
      {
        path: '/volunteerList',
        meta: { title: '志愿表' },
        component: () => import('@/views/volunteerList'),
      },
      {
        path: '/accounts',
        meta: { title: '基本信息' },
        component: () => import('@/views/accounts/index.vue'),
      },
      {
        path: '/ping',
        meta: { title: '测评报告' },
        component: () => import('@/views/ping'),
      },
      {
        path: '/mobile',
        name: 'mobile',
        meta: { title: '测评报告' },
        component: () => import('@/views/ping/mobile.vue'),
      },
    ],
  },
  // 填报模块layout
  {
    path: '/optional',
    redirect: '/optional',
    component: layoutSchool,
    children: [
      {
        path: '/optional',
        meta: { title: '新高考选科' },
        component: () => import('@/views/optional/index.vue'),
        // component:Optional
      },
      {
        path: '/smartoptional',
        name: 'smartoptional',
        meta: { title: '智能选科' },
        component: () => import('@/views/smartOptional/index.vue'),
      },
      {
        path: '/appraisal',
        name: 'appraisal',
        meta: { title: '测评报告' },
        component: () => import('@/views/appraisal/index.vue'),
      },
      {
        path: '/mobile',
        name: 'mobile',
        meta: { title: '测评报告' },
        component: () => import('@/views/appraisal/mobile.vue'),
      },
      {
        path: '/college/searchCollege',
        name: 'searchCollege',
        meta: { title: '找大学' },
        component: () => import('@/views/searchCollege/index.vue'),
      },
      {
        path: '/batchInfo',
        name: 'batchInfo',
        meta: { title: '志愿填报' },
        component: () => import('@/views/batchInfo/index.vue'),
      },
      {
        path: '/volunteer',
        name: 'volunteer',
        meta: { title: '志愿填报' },
        component: () => import('@/views/volunteer/index.vue'),
      },
      {
        path: '/yijiantianbao',
        name: 'yijiantianbao',
        meta: { title: '志愿填报' },
        component: () => import('@/views/yijiantianbao/index.vue'),
      },
      {
        path: '/saveVolunteer',
        name: 'saveVolunteer',
        meta: { title: '志愿填报' },
        component: () => import('@/views/saveVolunteer/index.vue'),
      },
      {
        path: '/tempVolunteer',
        name: 'tempVolunteer',
        meta: { title: '志愿填报' },
        component: () => import('@/views/tempVolunteer/index.vue'),
      },
    ],
  },
  // 找大学模块layout
  {
    path: '/college',
    redirect: '/college/searchCollege',
    component: layoutCollege,
    children: [
      {
        path: '/college/searchCollege',
        name: 'searchCollege',
        meta: { title: '找大学' },
        component: () => import('@/views/searchCollege/index.vue'),
      },
      {
        path: '/college/detail',
        name: 'detail',
        meta: { title: '找大学详情' },
        component: () => import('@/views/detail/index.vue'),
      },

      {
        path: '/collegeCompare',
        name: 'collegeCompare ',
        meta: { title: '院校对比' },
        component: () => import('@/views/collegeCompare/index.vue'),
      },

      {
        path: '/majorLibrary',
        name: 'majorLibrary',
        meta: { title: '专业库' },
        component: () => import('@/views/majorLibrary/index.vue'),
      },
      {
        path: '/majorLibrary/majorLibraryDet',
        name: 'majorLibraryDet',
        meta: { title: '专业库详情' },
        component: () => import('@/views/majorLibraryDet/index.vue'),
      },
      {
        path: '/majorLibrary/majorLibraryDetMidd',
        name: 'majorLibraryDetMidd',
        meta: { title: '专业库详情' },
        component: () => import('@/views/majorLibraryDetMidd/index.vue'),
      },
      {
        path: '/jorLibrary',
        name: 'jorLibrary',
        meta: { title: '职业库' },
        component: () => import('@/views/jorLibrary/index.vue'),
      },
      {
        path: '/jorLibrary/jorLibraryDet',
        name: 'jorLibraryDet',
        meta: { title: '职业库详情' },
        component: () => import('@/views/jorLibraryDet/index.vue'),
      },
      {
        path: '/jorLibrary/jorLibraryDet/jorDet',
        name: 'jorDet',
        meta: { title: '职业详情' },
        component: () => import('@/views/jorDet/index.vue'),
      },
      {
        path: '/tiQianPi',
        name: 'tiQianPi',
        meta: { title: '提前批' },
        component: () => import('@/views/tiQianPi/index.vue'),
      },
      {
        path: '/positionalQuery',
        name: 'positionalQuery',
        meta: { title: '位次查询' },
        component: () => import('@/views/positionalQuery/index.vue'),
      },
      {
        path: '/picixian',
        name: 'picixian',
        meta: { title: '批次线' },
        component: () => import('@/views/picixian/index.vue'),
      },
      {
        path: '/scoreLine',
        name: 'scoreLine',
        meta: { title: '分数线' },
        component: () => import('@/views/scoreLine/index.vue'),
      },
    ],
  },
  // 找大学详情layout
  {
    path: '/college/detail',
    redirect: '/college/detail',
    component: layoutCollegeDetail,
    children: [
      {
        path: '/college/detail',
        name: 'detail',
        meta: { title: '院校简介' },
        component: () => import('@/views/detail/index.vue'),
      },
      {
        path: '/college/detail/intro',
        name: 'intro',
        meta: { title: '院校介绍' },
        component: () => import('@/views/collegIntro/index.vue'),
      },
      {
        path: '/college/admissionsguide',
        name: 'admissionsguide',
        meta: { title: '招生简章' },
        component: () => import('@/views/admissionsguide/index.vue'),
      },
      {
        path: '/college/admissionsguide/det',
        name: 'admissionsdet',
        meta: { title: '招生简章详情' },
        component: () => import('@/views/admissionsDet/index.vue'),
      },
      {
        path: '/college/detScoreLine',
        name: 'detScoreLine',
        meta: { title: '录取分数线' },
        component: () => import('@/views/detScoreLine/index.vue'),
      },
      {
        path: '/college/enrollmentplan',
        name: 'enrollmentplan',
        meta: { title: '招生计划' },
        component: () => import('@/views/enrollmentPlan/index.vue'),
      },
      {
        path: '/college/collegeimgs',
        name: 'collegeImgs',
        meta: { title: '院校风采' },
        component: () => import('@/views/collegeImgs/index.vue'),
      },
      {
        path: '/college/preFraction',
        name: 'preFraction',
        meta: { title: '提前批招生计划' },
        component: () => import('@/views/preFraction/index.vue'),
      },
      {
        path: '/college/tiqianpiScoreline',
        name: 'tiqianpiScoreline',
        meta: { title: '提前批分数线' },

        // component: () => import('@/views/preFractionScoreline/index.vue')
        component: () => import('@/views/tiqianpiScoreline/index.vue'),
      },
    ],
  },

  {
    path: '/login',
    component: () => import('@/views/login'),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
